const XLSX = require('xlsx')
const fs = require('fs')
const filePath = './20191015_offres_64711.xlsx'
const outPath = './test.xlsx'

// var workbook = XLSX.readFile('./20191015_offres_64711.xlsx')

// XLSX.writeFile(workbook, './test.xlsx')
// console.log(XLSX.utils.sheet_to_json('./test.xlsx'))

const data = fs.readFileSync(filePath)
const workbook = XLSX.read(data, {
  type: 'buffer'
})
const xlsx_data = XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[0]])
    const ws = XLSX.utils.json_to_sheet(xlsx_data)
    const wb = XLSX.utils.book_new()
    XLSX.utils.book_append_sheet(wb, ws)
    XLSX.writeFile(wb, outPath, {
      compression: false, 
      bookSST: true,
      bookType: 'xlsx'
    })